//
//  Tool.swift
//  TestProject
//
//  Created by 万想想 on 2020/8/19.
//  Copyright © 2020 edaili. All rights reserved.
//

import UIKit
import Alamofire
class Tool {

    class func isNetworkConnect() -> Bool {
        let network = NetworkReachabilityManager()
        return network?.isReachable ?? true
    }
    
    //MARK:获取当前年月日时分秒
    class func getCurrentYearMonthDayHourMinuteSecond() -> String {
        let now = Date()
        let time1970 = now.timeIntervalSince1970
        let dateTime = Date(timeIntervalSince1970: time1970)
        let dateformatter = DateFormatter()
        dateformatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
        let currentDateStr = dateformatter.string(from: dateTime)
        return currentDateStr
    }
    
    class func getSavePath() -> String{
        let path = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.cachesDirectory, FileManager.SearchPathDomainMask.userDomainMask, true)[0]
        return path
    }
}
